﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Noea.TogSim.Model.Interfaces
{
    public delegate void SignalHandler(ISignal signal, ISignalEventArgs e);

    public interface ISignal
    {
        // Properties
        /// <summary>
        /// Identification of the signal
        /// </summary>
        int Id { get; }
        /// <summary>
        /// State of the signal
        /// </summary>
        ISignalState State { get; set; }
        /// <summary>
        /// Associated signal. Used for pre-signaling
        /// </summary>
        ISignal AssociatedSignal { get; set; }
        event SignalHandler OnChange;
    }

    /// <summary>
    /// Valid states for signals
    /// </summary>
    public interface ISignalEventArgs
    {
        ISignal Signal { get; }
        Object OldValue { get; }
        Object NewValue { get; }
    }
}
